﻿using System.Windows;

namespace WebCamViewer
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Window1 : Window
    {
        public WebCamSettingsWindowHandler WebCamSettingsHandler;
        public WebCamWindowHandler WebCamHandler;

        public Window1()
        {
            InitializeComponent();
            WebCamSettingsHandler = new WebCamSettingsWindowHandler(this);
            WebCamHandler = new WebCamWindowHandler(this);
            Loaded += new RoutedEventHandler(Window1_Loaded);
        }

        void Window1_Loaded(object sender, RoutedEventArgs e)
        {
            WebCamHandler.CreateWindow(this);            
        }

        private void btnWebCam_Click(object sender, RoutedEventArgs e)
        {
            WebCamHandler.CreateWindow(this);            
        }

        private void btnSettings_Click(object sender, RoutedEventArgs e)
        {
            WebCamSettingsHandler.CreateWindow(this);
            WebCamSettingsHandler._window.WebcamVideoControl = WebCamHandler._window.WebCam;
        }
    }
}
